<template>
	<view class="imgnavbar">
		

		<image class="mainView">
		
		</image>
			
		
		<view class="contentView" >
		
	
			<view class="contentImageView"  v-for="(item, index) in jdata.params.list" :key="index">
				
		
				<image class="imgnavbarcontent" :src="item.image" mode="heightFix" @click="showSliderInfo(item.linkType, item.linkValue)"></image>
		
				<view class="imgnavbar-item-text"  @click="showSliderInfo(item.linkType, item.linkValue)">{{item.text}}</view>
							
				
		
			</view>
			
	
	
		</view>
			
		
		

	</view>
</template>

<script>
	export default {
		name: "jshopnavbar",
		props: {
			jdata: {
				// type: Object,
				required: true,
			}
		},
		data() {
			return {
				height: '',
				height1: ''
			}
		},
		onLoad() {

		},
		mounted() {

		},
		methods: {
			showSliderInfo(type, val) {
		
				if (!val) {
					return;
				}
		
				if (type == 1) {
					if (val.indexOf('http') != -1) {
						// #ifdef H5 
						window.location.href = val
						// #endif
						// #ifndef H5
						uni.navigateTo({
							url: '/pages/webview/index.vue?src=' + val
						})
						// #endif
					} else {
						// #ifdef H5 || APP-PLUS || APP-PLUS-NVUE || MP
						if (val == '/pages/index/index' || val == '/pages/classify/classify' || val == '/pages/cart/index/index' || val == '/pages/member/index/index') {
							uni.switchTab({
								url: val
							});
							return;
						} else {
							this.$common.navigateTo(val);
							return;
						}
						// #endif
					}
				} else if (type == 2) {
					// 商品详情
					this.goodsDetail(val)
				} else if (type == 3) {
					// 文章详情
					this.$common.navigateTo('/pages/article/index?id=' + val + '&id_type=1')
				} else if (type == 4) {
		
					// 文章列表
					this.$common.navigateTo('/pages/article/list?cid=' + val)
				} else if (type == 5) {
					//智能表单 
					this.$common.navigateTo('/pages/form/detail/form?id=' + val)
				}
			},
			//跳转到商品详情页面
			goodsDetail: function(id) {
				let url = '/pages/goods/index/index?id=' + id;
				this.$common.navigateTo(url);
			},
		}
	}
</script>

<style>
	.imgnavbar {
		width: 100%;

		z-index: 999999;
		
		height: 368upx;
		
	

		/* margin-bottom: 20rpx; */
	}
	
	
	
	.mainView{
		
		position: absolute;
		
		z-index: 1;
		
		width: 688upx;
		
		height: 368upx;
		
		border-radius: 5upx;
		
		margin-left: 36upx;
		
		
		background-color: #FFFFFF;
		

	
		box-shadow: 0 6upx 14upx 0 rgba(0,0,0,0.06), 0 4upx 8upx 0 rgba(0,0,0,0.03), 0 2upx 4upx 0 rgba(0,0,0,0.03);
	
		
	}
	
	.contentView{
		
		z-index: 9999;
		
		
		
		width: 688upx;
		
		height: 368upx;
		
		margin-left: 36upx;
		
		
		
		
		/* background-color: #007AFF; */
		
		
		display: flex;
		
		/* margin-top: 40upx; */
		
		flex-direction: row;
		
		
		flex-wrap: wrap;
		
		
		
	}
	
	


	
	
	.contentImageView{
		
		display: flex;
		
		width: 20%;
		
		/* height: 150upx; */
		
		flex-direction: column;
		
		align-items: center;
		
		margin-top: 0upx;
		
		
		/* background-color: #00BFFF; */
		
		z-index: 99;

		
	}
	
	
	
	.imgnavbarcontent{
		
		height: 92upx;
		
		width: 92upx;
		
		margin-top: 36upx;
		
		/* height: 100%; */
		
		
	}
	


/* 	.imgnavbar-item image {
		
		margin-left: 20upx;
		margin-top: 15upx;
		width: 70upx;
		height: 70upx;

	} */

	.imgnavbar-item-text {
		font-size: 20upx;
		color: #3A3A3A;
		
		/* background-color: #0D9E13; */
		
		/* margin-left: 20upx;
		 */
		
		margin-top: 6upx;
		
		/* line-height: 90upx; */
		
		/* width: 100%; */

	}

	
</style>
